Black document: GitHub Actions integration
https://black.readthedocs.io/en/stable/integrations/github_actions.html
設定を試したメモ
このアクションだけではコミットまではされない
単体での使用例:--check --diffのようにしてフォーマットの必要の有無をチェックする
psf/black@stableを使う
You can also configure the arguments passed to Black via options (defaults to '--check --diff') and src (default is '.')
--line-length
https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#line-length
https://github.com/psf/black/blob/main/action.yml が動く
パラメタのblack_argsはdeprecated。optionsを使う
https://github.com/psf/black/blob/main/action/main.py を実行している
実装:subprocess.runで以下を実施
venv作成(sys.executableを指定する!)
pip install
black
stableはタグの指定
2021年4月、stableが見つからないというIssueが上がった
https://github.com/psf/black/issues/2079#issuecomment-861289203